window.$axios = $axios = axios.create({
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  }
})
$axios.interceptors.request.use(config => {
  if (!config.params) {
    config.params = {};
  }

  // config.params[SESSION_KEY] = getCookies().sessionValue
  // config.params[TOKEN_KEY] = getCookies().tokenValue
  config.params['t'] = new Date().getTime()
  console.log(config)
  config.data = Qs.stringify(config.data)
  return config
}, error => {
  return Promise.reject(error);
})
$axios.interceptors.response.use(response => {
  return response.data
}, error => {
  return Promise.reject(error);
})